﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Paint
{
    [Serializable]
    class Pencil : Drawable
    {
        private List<Point> points = new List<Point>();

        public Pencil(Point startPoint, Point endPoint) : base(startPoint, endPoint) { }

        public override void draw(Graphics g)
        {
            points.Add(endPoint);
            for (int i = 1; i < points.Count; i++)
            {
                g.DrawLine(context.createPen(), points[i - 1], points[i]);
            }
        }

        public void clearPoints() 
        {
            points.Clear();
        }
    }
}
